﻿using Draco.OWF.RT;
using Draco.OWF.Metadata;
using Draco.OWF.Metadata.DataBinding;

namespace Draco.OWF.Activity
{
    public abstract class AbstractActivity: IRunableActivity
    {
        protected ActivityModel activityModel;
        public ActivityModel ActivityModel
        {
            set
            {
                this.activityModel = value;
            }
        }

        public virtual void Init()
        {
        }

        public BindingDataSchema InputSchema { get { return activityModel.InputSchema; } }
        public BindingDataSchema OutputSchema { get { return activityModel.OutputSchema; } }
        public BindingData InputData { get { return activityModel.InputData; } }

        public ActivityConfiguration Config
        {
            get
            {
                return this.activityModel.Configuration;
            }
        }

        #region abstract method
        public abstract void ExecuteTask(ITaskContext context);
        public abstract string ActivityType { get; }
        #endregion
    }
}
